package com.dlb.andorid.presenter;

import com.dlb.andorid.XAPI;
import com.dlb.andorid.XContract;
import com.dlb.andorid.XPresenter;
import com.dlb.andorid.XServerMsg;
import com.dlb.andorid.bean.UserAccount;

import java.util.HashMap;
import java.util.List;

public class MxPresenter extends XPresenter {

	XContract.IMxView iView;

	public MxPresenter(XContract.IMxView iView) {
		super(iView);
		this.iView = iView;
	}

	public void getMxList(){
		mModel.getUserAccount();
	}

	@Override
	public void onDataSuccess(int vocational_id, HashMap<String, Object> exData, Object data) {
		super.onDataSuccess(vocational_id, exData, data);

		switch (vocational_id){
			case XAPI.GET_USER_ACCOUNT_VOCATIONAL_ID:
				iView.getMxListSuccess(((XServerMsg<List<UserAccount>>)data).getData());
				break;
		}

	}
}
